<?php

namespace app\http\middleware;

class Check{
    //第三个参数，可以通过路由赋值传递
    public function handle($request, \Closure $next, $name)
    {
        //下面这一句是 给控制器 传值
        $request->hello = 'ThinkPHP';
    echo 1;
    exit;
        if ($name == 'think') {
            return redirect('index/think');
        }

        return $next($request);
    }

}